<?php

class SubjectStOboryService extends ServiceAbstract {
	
	private $_mapper;
	
	
	public function __construct(){
		$this->_mapper = new Db_Mapper_SubjectStObory();	
	}
	
	/** Priradi predmet oboru
	 * 
	 * @param integer $sid
	 * @param integer $idOboru
	 * 
	 * @return boolean
	 */
	public function add($sid,$idOboru){
		
		$sid = (int)$sid;
		$idOboru = (int)$idOboru;
		
		
		if($sid == 0 || $idOboru == 0){
			return false;
		}
		
		$model = new Db_Model_SubjectStObory(array(
			'sid' => $sid,
			'Id_oboru' => $idOboru
			)
		);
				
		return ($this->_mapper->save($model,true) > 0) ? true : false;		
	}
}

?>